{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# SYM-PART\n",
    "\n",
    "The SYM-PART <cite data-cite=\"sym_part\"></cite> problem suite is a multi-modal multi-objective optimization problem (MMOP).\n",
    "**In MMOPs, a solution $y$ in the objective space may have several inverse images in the decision space**.\n",
    "For this reason, an MMOP could have more than one Pareto subsets.\n",
    "\n",
    "The SYM-PART has two variants: SYM-PART simple and SYM-PART rotated. Both of them have the same Pareto front.\n",
    "But their Pareto sets are different."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1. SYM-PART Simple"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Pareto subsets"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.multi.sympart import SYMPART, SYMPARTRotated\n",
    "from pymoo.visualization.scatter import Scatter\n",
    "\n",
    "problem = SYMPART()\n",
    "ps = problem.pareto_set()\n",
    "Scatter(title=\"Pareto set\", xlabel=\"$x_1$\", ylabel=\"$x_2$\").add(ps).show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Pareto front"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "pf = problem.pareto_front()\n",
    "Scatter(title=\"Pareto front\").add(pf).show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2. SYM-PART Rotated\n",
    "### Pareto subsets\n",
    "The pareto subsets can be rotated."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from numpy import pi\n",
    "\n",
    "# rotate pi/3 counter-clockwisely\n",
    "problem = SYMPARTRotated(angle=pi/3)\n",
    "ps = problem.pareto_set()\n",
    "Scatter(title=\"Pareto set\", xlabel=\"$x_1$\", ylabel=\"$x_2$\").add(ps).show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Pareto front"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "pf = problem.pareto_front()\n",
    "Scatter(title=\"Pareto front\").add(pf).show()"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
